#include <stdio.h>
#include<unistd.h>
#include<stdlib.h>
char*const addenv[]={
        (char*const)"myval1=1",
        (char*const)"myval2=2",
        (char*const)"myval3=3",
        NULL
    };
int main()
{

    //进程切换
    
    //execl("/usr/bin/ls","ls","-l","-a",NULL);//l:代码列表一样给参数

    //execlp("ls","ls","-l","-a",NULL);//p:代表可以自己在环境变量里面找
    char*const str[]={
       (char*const) "ls",
       (char *const)"-l",
       (char*const)"-a",
       NULL
    };//都要以null结束,v:vector
    //execv("/usr/bin/ls",str);
    //execvp("ls",str);
    execle("./test_main_env","./test_main_env","q","w","w","q",NULL,addenv);

    printf("hello llm\n");
    
    return 0;
}

